package com.desksoft.ecommerce.service.interf.mall;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.desksoft.ecommerce.entity.logistics.dto.ItemextWithBLOBs;
import com.desksoft.ecommerce.entity.mall.dto.MallImages;
import com.desksoft.ecommerce.util.result.ServiceResult;
import com.desksoft.ecommerce.vo.logistics.CategoryVO;
import com.desksoft.ecommerce.vo.logistics.StorageVO;
import com.desksoft.ecommerce.vo.logistics.StoreItemQryVO;
import com.desksoft.ecommerce.vo.logistics.StoreItemVO;
import com.desksoft.ecommerce.vo.mall.AdvlistQryVO;
import com.desksoft.ecommerce.vo.mall.BrandVO;
import com.desksoft.ecommerce.vo.mall.CategoryNodeVO;
import com.desksoft.ecommerce.vo.mall.DescDataVO;
import com.desksoft.ecommerce.vo.mall.HelpInfoVO;
import com.desksoft.ecommerce.vo.mall.ItemCharacterDVO;
import com.desksoft.ecommerce.vo.mall.ItemDetailVO;
import com.desksoft.ecommerce.vo.mall.ItemExtVO;
import com.desksoft.ecommerce.vo.mall.ItemcharacterVO;
import com.desksoft.ecommerce.vo.mall.LimitPromVO;
import com.desksoft.ecommerce.vo.mall.MallImagesVO;
import com.desksoft.ecommerce.vo.mall.MallMessageVO;
import com.desksoft.ecommerce.vo.mall.NextFrameVO;
import com.desksoft.ecommerce.vo.mall.PavilionVO;
import com.desksoft.ecommerce.vo.mall.ProDetailInfoVO;
import com.desksoft.ecommerce.vo.mall.ProductsInfo;
import com.desksoft.ecommerce.vo.mall.PromotionItemVO;
import com.desksoft.ecommerce.vo.mall.R002VO;
import com.desksoft.ecommerce.vo.mall.ShareFriendVO;
import com.desksoft.ecommerce.vo.mall.WholesalePriceVO;
import com.desksoft.ecommerce.vo.vendor.ColorAndSizeVO;
import com.desksoft.utility.pagination.Page;
import com.desksoft.utility.service.ServiceInterface;

/**
 * 处理商品信息公共方法
 *
 * @param
 * @param
 * @return
 */
public interface IProductsService extends ServiceInterface {

	/**
	 * 判断商品订购量和库存
	 *
	 * @param
	 * @param
	 * @return
	 */

	public ServiceResult<MallMessageVO> checkStoreItemQty(StoreItemVO storeItemVO);

	/**
	 * 获取商品信息
	 *
	 * @param
	 * @param
	 * @return
	 */

	public ServiceResult<List<ProductsInfo>> getItemInfo(WholesalePriceVO wholesalePriceVO);

	/**
	 * 获取商品库存信息
	 *
	 * @param
	 * @param
	 * @return
	 */

	public ServiceResult<StorageVO> getStockByItem(StorageVO storageVO);

	/**
	 * 获取商品分类信息
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<Map<String, Object>> getItemCategory(StoreItemQryVO storeItemQryVO);

	/**
	 * 获取商品图片信息
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<List<MallImagesVO>> getItemImgInfo(MallImagesVO mallImagesVO);

	/**
	 * 获取商品基本信息
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<StoreItemVO> getStoreItemInfo(StoreItemVO storeItemVO);

	/**
	 * 获取商品小类的特征属性
	 *
	 * @param
	 * @param
	 * @return
	 */

	public ServiceResult<ItemExtVO> getProDetailIntro(ItemCharacterDVO itemCharacterDVO);

	/**
	 * 获取限时特价
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<LimitPromVO> getPromotionItemInfo(PromotionItemVO promotionItemVO);

	/**
	 * 获取相关促销
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<List<R002VO>> getSalesPromotion(PromotionItemVO promotionItemVO);

	/**
	 * 获取商品价格信息
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<ItemDetailVO> getItemPrice(WholesalePriceVO wholesalePriceVO);

	/**
	 * 获取商品参数信息B2c
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<ProDetailInfoVO> getProDetailInfo(com.desksoft.ecommerce.vo.mall.StoreItemVO storeItemVO);

	/**
	 * 获取商品 特征属性数据结构
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<Map<String, List<DescDataVO>>> getCharaItem(ProDetailInfoVO proDetailInfoVO);

	/**
	 * 分享给好友
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<ShareFriendVO> getShareFriend(String cardNo, String itemcode);

	/**
	 * 获取浏览记录商品信息
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<List<ProductsInfo>> getbrowselist(WholesalePriceVO wholesalePriceVO);

	public ServiceResult<Map<String, Object>> dostockout(String camount);

	public ServiceResult<ProductsInfo> getSingleSEO(ProductsInfo productsInfo);

	public ServiceResult<List<StoreItemVO>> getrankingCode(StoreItemVO storeItemVO);

	/**
	 * 获取总排行榜信息
	 *
	 * @param
	 * @param
	 * @return
	 */
	public ServiceResult<List<StoreItemVO>> getrankingTotal(String storecode);

	public ServiceResult<List<ProductsInfo>> getCommentList(String itemcode);

	/**
	 * 获取促销信息
	 *
	 * @param storeItemVO
	 * @return
	 */
	public ServiceResult<List<StoreItemVO>> getStoreItemSale(StoreItemVO storeItemVO);

	/**
	 * 根据商品编码获取促销商品名称、价格、图片等信息
	 *
	 * @param list
	 * @param storeItemVO
	 * @return
	 */
	public ServiceResult<List<StoreItemVO>> getSalePrice(List<StoreItemVO> saleList, StoreItemVO storeItemVO);

	/**
	 * 获取展馆和一级分类和推荐分类
	 *
	 * @param itemBolb
	 * @return
	 */
	public ServiceResult<Map<String, Map<String, List<PavilionVO>>>> getExhibitioHall(String userid, int maxCount);// 

	/**
	 * 虚拟展馆获取二级和三级
	 *
	 * @param itemBolb
	 * @return
	 */
	public ServiceResult<Map<String, List<PavilionVO>>> getExhibitioRight(String CategoryZ, String userid);// 

	/**
	 * 获取展馆的推荐品牌
	 *
	 * @param itemBolb
	 * @return
	 */
	public ServiceResult<List<PavilionVO>> getExhibitioBrand(String userid, String paviCode);// 

	/**
	 * 获取展馆的推荐促销
	 *
	 * @param itemBolb
	 * @return
	 */
	public ServiceResult<List<PavilionVO>> getExhibitioPromotion(String paviCode);// 
	/**
	 * 阶梯模块一级显示和全部显示的取法
	 *
	 * @param itemBolb
	 * @return
	 */
	public ServiceResult<Map<String, Map<String, List<PavilionVO>>>> getClassification(PavilionVO pavilionVO);// 

	/**
	 * 阶梯模块二级取法
	 *
	 * @param itemBolb
	 * @return
	 */
	public ServiceResult<Map<String, List<PavilionVO>>> getsecondary(PavilionVO pavilionVO);// 

	/**
	 * 更新商品编辑更新扩展信息表
	 *
	 * @param itemBolb
	 * @return
	 */
	public ServiceResult<Integer> updateByPrimaryKeySelective(ItemextWithBLOBs itemBolb);

	/**
	 * 得到商品扩展信息
	 *
	 * @param vo
	 * @return
	 */
	public ServiceResult<ItemExtVO> getItemExtInfo(ItemExtVO vo);

	/**
	 * 首页商品品牌列表
	 *
	 * @param vo
	 * @return
	 */
	public ServiceResult<List<BrandVO>> getBrandList(BrandVO brandVO);

	/**
	 * 商品图片插入
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<Integer> insertMallImage(MallImages recode);

	/**
	 * 下架市场价为0的商品
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<Boolean> updateMarket(NextFrameVO nextFrameVO);

	/**
	 * 下架批发价为0的商品
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<Boolean> updateWholesale(NextFrameVO nextFrameVO);

	/**
	 * 下架基础价为0的商品
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<Boolean> updateFoundation(NextFrameVO nextFrameVO, String itemCode);

	/**
	 * 下架淘汰商品
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<Boolean> updateOut(NextFrameVO nextFrameVO);

	/**
	 * 下架缺货商品
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<Boolean> updateStockout(NextFrameVO nextFrameVO);

	/**
	 * 获取商品所有分类
	 *
	 * @param cate
	 * @return
	 */
	public ServiceResult<List<CategoryNodeVO>> getCategory(CategoryVO cate);

	public ServiceResult<Page<ProductsInfo>> searchItemorCategory(StoreItemQryVO storeitem);

	/**
	 * 获取帮助中心所有分类
	 *
	 * @param cate
	 * @return
	 */
	public ServiceResult<Map<String, List<HelpInfoVO>>> getThispaperC(HelpInfoVO helpInfoVO);

	/**
	 * 根据文章编号获取相关信息
	 *
	 * @param cate
	 * @return
	 */
	public ServiceResult<HelpInfoVO> getHelpCode(HelpInfoVO helpInfoVO);

	/**
	 * 根据文章编号修改信息内容
	 *
	 * @param cate
	 * @return
	 */
	public ServiceResult<Boolean> updateThispaper(HelpInfoVO helpInfoVO);

	/**
	 * 是否存在商品
	 *
	 * @param itemCode
	 * @return
	 */
	public ServiceResult<Integer> isExistsProduct(Map<String, String> itemMap);

	/**
	 * 获取后台品牌列表
	 *
	 * @param itemCode
	 * @return
	 */
	public ServiceResult<Page<BrandVO>> getBrandLists(AdvlistQryVO advlistQryVO);

	/**
	 * 插入Brand表没有的品牌名称
	 *
	 * @param
	 * @return
	 */
	public ServiceResult<Integer> setBrandName(String userid);

	/**
	 * 保存Brand表的数据
	 *
	 * @param
	 * @return
	 */
	public ServiceResult<Boolean> saveBrand(BrandVO brandVO);

	/**
	 * 保存Brand表品牌图
	 *
	 * @param
	 * @return
	 */
	public ServiceResult<Boolean> saveBrandLog(BrandVO brandVO);

	/**
	 * 根据商品扩展信息
	 *
	 * @param itemCode
	 * @return
	 */
	public ServiceResult<ItemextWithBLOBs> selectByPrimaryKey(String itemCode);

	/**
	 * 获取促销列表
	 *
	 * @param itemCode
	 * @return
	 */
	public ServiceResult<Page<R002VO>> getPromotionLists(AdvlistQryVO advlistQryVO);

	/**
	 * 获取门店符合下架的商品
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<List<NextFrameVO>> getStore(NextFrameVO nextFrameVO, String pricetype);

	/**
	 * 获取总部的商品
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<List<NextFrameVO>> getStoreAll(NextFrameVO nextFrameVO, String pricetype);

	/**
	 * @author LiuWenLong
	 * @version 2012-12-7 下午4:58:40
	 * @description TODO
	 * @param vendorCodeMap
	 * @param windowshopProductNum
	 * @return
	 */
	public ServiceResult<HashMap<String, Page<ProductsInfo>>> selectProductsByVendorMap(
			HashMap<String, String> vendorCodeMap, int windowshopProductNum);

	/**
	 * @author LiuWenLong
	 * @version 2012-12-7 下午5:07:20
	 * @description TODO
	 * @param vendorCode
	 * @param windowshopProductNum
	 * @return
	 */
	public ServiceResult<Page<ProductsInfo>> selectProductsByVendor(String vendorCode, int windowshopProductNum);
	/**
	 * 供应商最新上架商品
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<List<StoreItemVO>> selectStoreItemItemCode(StoreItemVO storeItemVO);

	/**
	 * 月销量排行榜
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<List<StoreItemVO>> selectStoreItemAvgSaleQty(StoreItemVO storeItemVO);
	
	public Page<ProductsInfo> selectProductListByVendor(String vendorCode, int windowshopProductNum);

	/**
	 * @author LiuWenLong
	 * @version 2013-1-31 下午4:11:58
	 * @description TODO
	 * @param storeItem
	 * @return
	 */
	public String selectProductOnHead(StoreItemVO storeItem);

	/**
	 * 删除商品图片
	 * @param imageTypeId
	 * @return
	 */
	public Integer deleteByImgtypeId(String imageTypeId);
	
	/**
	 * 查询大类下的商品信息
	 * @param 
	 * @return
	 */
	
	public ServiceResult<Page<ProductsInfo>>  selectStoreItemD(StoreItemVO storeItem);
	
	
	/**
	 * 查询库存为0的商品
	 * @param 
	 * @return
	 */
	
	public ServiceResult<List<StoreItemVO>>  selectStoreItemInventory(StoreItemVO storeItem);

	/**
	 * @author LiuWenLong
	 * @version 2013-5-15 下午4:39:27
	 * @description TODO
	 * @param product
	 */
	void padImageInfo(Object product);

	/**
	 * @author LiuWenLong
	 * @version 2013-5-17 上午10:41:50
	 * @description TODO
	 * @param productList
	 */
	void padImageInfoList(List productList);
	/**
	 * @author wgl
	 * @version 2013-5-17 上午10:41:50
	 * @description TODO
	 * @param productList
	 */
	public ServiceResult<HashMap<String, Object>> selectProductsAttribute(ColorAndSizeVO colorAndSizeVO);
	
	/**
	 * 查询商品扩展属性
	 * @param
	 * @return
	 */
	public ServiceResult<List<ItemcharacterVO>> getProductsExtendAttribute(ItemcharacterVO istemcharacterVO);
	/**
	 * 商品图片更新
	 *
	 * @param recode
	 * @return
	 */
	public ServiceResult<Integer> updateMallImage(MallImages recode);
}
